#include "student.h"
#include<QDebug>
Student::Student(QObject *parent)
    : QObject{parent}
{}

void Student::treat()
{
    qDebug()<<"请老师吃饭";
}

void Student::treat(QString foodname)
{
    //qDebug()<<"请老师吃饭，老师要吃"<<foodname;//直接打印QString类型会带“”，
    qDebug()<<"请老师吃饭，老师要吃"<<foodname.toUtf8().data();//如果想去掉先用toUtf8()转成QByteArray,再用data()转为char；
}
